load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "tablestore",
    srcs = [
        "notifier.go",
        "sql.go",
        "store.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/timer/tablestore",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/kv",
        "//pkg/parser/terror",
        "//pkg/sessionctx",
        "//pkg/sessionctx/variable",
        "//pkg/timer/api",
        "//pkg/util",
        "//pkg/util/chunk",
        "//pkg/util/logutil",
        "//pkg/util/sqlexec",
        "//pkg/util/timeutil",
        "@com_github_google_uuid//:uuid",
        "@com_github_pingcap_errors//:errors",
        "@com_github_tikv_client_go_v2//util",
        "@io_etcd_go_etcd_api_v3//mvccpb",
        "@io_etcd_go_etcd_client_v3//:client",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "tablestore_test",
    timeout = "short",
    srcs = ["sql_test.go"],
    embed = [":tablestore"],
    flaky = True,
    race = "on",
    shard_count = 8,
    deps = [
        "//pkg/kv",
        "//pkg/meta/model",
        "//pkg/parser/mysql",
        "//pkg/planner/core/resolve",
        "//pkg/sessionctx",
        "//pkg/sessionctx/variable",
        "//pkg/timer/api",
        "//pkg/types",
        "//pkg/util/sqlexec",
        "@com_github_ngaut_pools//:pools",
        "@com_github_pingcap_errors//:errors",
        "@com_github_stretchr_testify//mock",
        "@com_github_stretchr_testify//require",
    ],
)
